<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- .lazy 将input事件变为chang事件 -->
        lazy测试:<input type="text" v-model.lazy="msg1">
        {{msg1}}
        <br>
        <!-- .number 收集的数据转为number类型 
            类似于parseFloat() 
            首个为数字则返回到达数字的末端为止
            首个为字符串则返回字符串内容  -->
        number测试:<input type="text" v-model.number="msg2">
        {{msg2}}
        <br>
        <!-- .trim 去除前后空格 -->
        trim测试:<input type="text" v-model.trim="msg3">
        {{msg3}}
    </div>
    <script>
        Vue.config.productionTip = false;

        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    msg1: '',
                    msg2: '',
                    msg3: '',
                    count: 0
                }
            }
        })
    </script>
</body>

</html>